#include"TcpServer.hpp" 
#include"ServerCal.hpp"

void Usage(const std::string &proc)
{
    std::cout<<"Usage: "<<proc<<" port\n"<<std::endl;
    exit(1);
}


int main(int argc, char* argv[])
{
    if(argc != 2)
    {
        Usage(argv[0]);
    }
    uint16_t port = std::stoi(argv[1]);
    ServerCal cal;
    TcpServer *tsvp = new TcpServer(port, std::bind(&ServerCal::Calculator, &cal, std::placeholders::_1));
    tsvp->InitServer();
    tsvp->Start();
    return 0;
}
















// int main()
// {
//     Request req(123,456,'+');
//     std::string s;
//     req.Serialize(&s);

//     s = Encode(s);
//     return 0;
// }